package com.common.network.request;


import com.common.network.dataConversion.ConversionImpl;
import com.common.network.response.BaseResponse;

import java.io.File;
import java.util.Map;

import okhttp3.RequestBody;

/**
 * Created by cms on 2016/12/6.
 */

public abstract class BaseRequest<T extends BaseResponse, F> {


    protected T response;

    protected F originalData;

    protected Object httpUrl;
    /**
     * GET 参数
     */
    protected String urlParameter;

    protected Map<String, String> map;

    /**
     * POST 参数
     */
    protected String header;

    protected RequestBody content;

    protected boolean isRequestEncryptionInterface;

    /**
     * 文件下载 参数
     */
    protected String fileUrl;

    protected String fileName;

    /**
     * 文件上传参数
     */
    protected File fileUpload;


    /**
     * 数据转换层
     */
    protected ConversionImpl conversion;

    /**
     * 标识
     */
    protected Object tag;


    public BaseRequest(T response, F originalData) {
        setResponse(response);
        setOriginalData(originalData);
    }

    public abstract String interfaceName();

    public T getResponse() {
        return response;
    }

    public void setResponse(T response) {
        this.response = response;
    }

    public F getOriginalData() {
        return originalData;
    }

    public void setOriginalData(F originalData) {
        this.originalData = originalData;
    }


    public String getUrlParameter() {
        return urlParameter;
    }

    public void setUrlParameter(String urlParameter) {
        this.urlParameter = urlParameter;
    }

    public Map<String, String> getMap() {
        return map;
    }

    public void setMap(Map<String, String> map) {
        this.map = map;
    }

    public Object getHttpUrl() {
        return httpUrl;
    }

    public void setHttpUrl(Object httpUrl) {
        this.httpUrl = httpUrl;
    }

    public RequestBody getContent() {
        return content;
    }

    public void setContent(RequestBody content) {
        this.content = content;
    }

    public String getHeader() {
        return header;
    }

    public void setHeader(String header) {
        this.header = header;
    }

    public boolean isRequestEncryptionInterface() {
        return isRequestEncryptionInterface;
    }

    public void setRequestEncryptionInterface(boolean requestEncryptionInterface) {
        isRequestEncryptionInterface = requestEncryptionInterface;
    }

    public ConversionImpl getConversion() {
        return conversion;
    }

    public void setConversion(ConversionImpl conversion) {
        this.conversion = conversion;
    }

    public Object getTag() {
        return tag;
    }

    public void setTag(Object tag) {
        this.tag = tag;
    }

    public String getFileUrl() {
        return fileUrl;
    }

    public void setFileUrl(String fileUrl) {
        this.fileUrl = fileUrl;
    }

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public File getFileUpload() {
        return fileUpload;
    }

    public void setFileUpload(File fileUpload) {
        this.fileUpload = fileUpload;
    }
}
